﻿using System;

namespace IceCS.DesignPattern.Core.AdapterPattern.MultiMediaPlayer
{
    public class MediaAdapter : IMediaPlayer
    {
        private IAdvancedMediaPlayer _advancedMediaPlayer;

        public string Play(string audioType, string fileName)
        {
            audioType = audioType.ToLowerInvariant();
            switch (audioType)
            {
                case "vlc":
                    _advancedMediaPlayer = new VlcPlayer();
                    return _advancedMediaPlayer.PlayVlc(fileName);
                case "mp4":
                    _advancedMediaPlayer = new Mp4Player();
                    return _advancedMediaPlayer.PlayMp4(fileName);
                default:
                    return String.Empty;
            }
        }
    }
}
